﻿{include file="public/header" /}
<title></title>
</head>

<body>
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 商家银行资质
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<form class="form form-horizontal" id="form-admin-add" method="post" style="width: 45%;">
		<div class="row cl">
			<label class="form-label col-xs-4"><span class="c-red">*</span>商户账号：</label>
			<div class="formControls col-xs-8 ">
				<input id="mobile" name="mobile" type="text" class="input-text" placeholder="请输入商家登录账号" >
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4"><span class="c-red">*</span>签约状态：</label>
			<div class="formControls col-xs-8 ">
				<select name="is_state" style="width: 210px;height: 25px;">
					<option value="0">全部</option>
					<option value="1">已认证</option>
					<option value="2">未认证</option>
					<option value="3">已驳回</option>
				</select>
			</div>
			<button type="submit" style="float: right;margin-top: 10px;width: 270px;height: 25px;">搜索</button>
		</div>
	</form>
	<div class="page-container">
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr class="text-c">
				<th>商户全称</th>
				<th>商户手机号</th>
				<th>状态</th>
				<th>增加时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			{volist name="list" id="vo" empty="这里没有数据"}
			<tr class="text-c">
				<td>
				{$vo.agent_name1}
				</td>
				<td>{$vo.mobile}</td>
				<td>
					{if $vo.state==1}
					<span style="color: #5eb95e;">已认证</span>
					{elseif $vo.state==2 || $vo.state==0}
					<span style="color: red;">待审核</span>
					{elseif $vo.state==3}
					<span style="color: #00a1d6;">已驳回</span>
					{else/}
					<span style="color: #5eb95e;">已初审</span>
					{/if}					
				</td>
				<td>{$vo.add_time}</td>
				<td class="td-manage">
					<a title="查看资料" href="{:url('agent_examine',['id'=>$vo.id])}"  class="ml-5" style="text-decoration:none">查看资料</a>
					{if $vo.state==2}
					<a title="驳回" style="color: #00a1d6;" href="javascript:;" onclick="agent_reject('驳回原因','{:url('sys/agent_reject',['id'=>$vo.id,'type'=>1])}','400','300')"  class="ml-5" style="text-decoration:none">驳回</a>
					<a title="通过" href="javascript:;" onclick="examine_pass(this,{$vo.id},1)"  class="ml-5" style="color: #5eb95e;">通过</a>
					{/if}
					<a title="" href="javascript:;" onclick="agent_nh('银行签约','{:url('sys/agent_nh',['id'=>$vo.id])}','400','600')" class="ml-5">银行签约</a>
				</td>
			</tr>
			{/volist}
			</tbody>
			</table>
			<style>
			.pagination li{float: left;}
			</style>
			<div id="pageNav" class="pageNav">{$list->render()}</div>
		</div>
		
		{include file="public/footer" /}
		<script type="text/javascript">
			/*审核通过*/
			function examine_pass(obj, id, type) {
				layer.confirm('确认审核通过吗？', {
					btn: ['确定', '取消'] //按钮
				}, function() {
					$.ajax({
						type: 'get',
						url: "{:url('sys/examine_pass')}",
						dataType: 'json',
						data: {
							id: id,
							type: type
						},
						success: function(data) {
							if(data.code == 200) {
								layer.msg(data.msg, {
								  icon: 1,
								  time: 1000 //2秒关闭（如果不配置，默认是3秒）
								}, function(){
									location.href = "{:url('sys/agent_shenhe2')}";
								});
							} else {
								layer.msg(data.msg, {
									icon: 1,
									time: 1000
								});
							}
						},
						error: function(data) {
							console.log(data.msg);
						}
					});
				});
			}
			
		/*审核驳回跳转*/
		function agent_reject(title, url, w, h) {
			layer_show(title, url, w, h);
		}
		
		/*银行签约*/
		function agent_nh(title, url, w, h) {
			layer_show(title, url, w, h);
		}
		</script>